<?php
include_once "xAP-functions/webincludes.php";
$body="<select name='Category'><option value=''>All";



$results=dbquery("Select distinct Category from xAP_News_Source order by Category");
foreach($results as $value){
	$chk="";
		if ($extradata["Category"]=="Cat-".$value["Category"]){
			$chk=" SELECTED ";
		}
	$body.="<option value='Cat-".$value["Category"]."'".$chk.">".$value["Category"];
}

$results=dbquery("Select SourceID,Alias from xAP_News_Source order by Alias");
foreach($results as $value){
	$chk="";
		if ($extradata["Category"]=="SRC-".$value["SourceID"]){
			$chk=" SELECTED ";
		}
	$body.="<option value='SRC-".$value["SourceID"]."'".$chk.">".$value["Alias"];
}


$body.="</select>";

echo LayoutWidgetConfig("Select Source",$body,$widgetid);
?>